package Test.MQ.ACK;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private MessageSender messageSender;

    @GetMapping("/send/auto/{message}")
    public String sendAutoAck(@PathVariable String message) {
        messageSender.sendToAutoAckQueue(message);
        return "已发送到自动ACK队列: " + message;
    }

    @GetMapping("/send/manual/{message}")
    public String sendManualAck(@PathVariable String message) {
        messageSender.sendToManualAckQueue(message);
        return "已发送到手动ACK队列: " + message;
    }
}